home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Select (Limited Edition)
/
Computer Select.iso
/
pcmag
/
v10n16
/
delbefor.bat
< prev
next >
Wrap
DOS Batch File
|
1991-08-27
|
674b
|
35 lines
@ECHO OFF
IF '%1'=='' GOTO syntax
IF NOT '%2'=='' GOTO syntax
ATTRIB +A *.*
MD TEMPDIR.$$$
XCOPY *.* TEMPDIR.$$$\*.* /M /D:%1
IF ERRORLEVEL 1 GOTO error1
ECHO Put a backup diskette in drive A: and
PAUSE
XCOPY *.* A: /M
IF ERRORLEVEL 1 GOTO error2
IF NOT EXIST *.* GOTO NoFiles1
ECHO Y | DEL *.* > NUL
:NoFiles1
COPY TEMPDIR.$$$\*.*
GOTO cleanup
:syntax
ECHO SYNTAX "DELBEFOR mm-dd-yy"
GOTO exit
:error1
ECHO Error during initial XCOPY. Aborting.
GOTO cleanup
:error2
ECHO Error during archive XCOPY. Files not deleted.
:cleanup
IF NOT EXIST TEMPDIR.$$$\*.* GOTO NoFiles2
ECHO Y | DEL TEMPDIR.$$$ > NUL
:NoFiles2
RD TEMPDIR.$$$
:exit